<?php

class Admin_Form_Stands_Stands extends Zend_Form {

    /**
     * Form for insert/update location
     * @author Nguyen Manh Hung
     */
    public function init() {
        $this->setAction('')->
                setMethod('post');

        $name = $this->createElement('text', 'post_title');

        $name->setLabel('Khán đài/Khu vực:')->
                setRequired(true)->
                setAttrib('size', 50)->
                setAttrib('maxlength', 255)->
                addValidator('NotEmpty')->
                addValidator('stringLength', false, array(
                    1,
                    255
                ));

        $description = $this->createElement('textarea', 'post_content', array('label' => 'Giới thiệu:', 'rows' => '10', 'cols' => '70'));
        $description->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim');

        $order = $this->createElement('text', 'post_order');
        $order->setLabel('Thứ tự:')->
                setRequired(false)->
                setAttrib('size', 10)->
                setAttrib('maxlength', 10);

        $status = $this->createElement('checkbox', 'post_status', array(
            'label' => 'Sử Dụng:',
            'checkedValue' => 1,
            'uncheckedValue' => 0
                ));

        $status->setValue(1);

        $submit = $this->createElement('submit', 'submit');

        $submit->setAttrib('id', 'submit_register');

        $submit->setLabel('Submit');

        $submit->setAttrib('class', 'formbutton');

        $submit->setDecorators(array(
            'ViewHelper',
            array(
                'HtmlTag',
                array(
                    'tag' => 'hb'
                ),
                array(
                    'Label',
                    array(
                        'tag' => ''
                    )
                )
            )
        ));

        $reset = $this->createElement('reset', 'reset', array(
            'label' => 'Làm Lại'
                ));

        $reset->setDecorators(array(
            'ViewHelper',
            array(
                'HtmlTag',
                array(
                    'tag' => 'hb'
                ),
                array(
                    'Label',
                    array(
                        'tag' => ''
                    )
                )
            )
        ));

        $reset->setAttrib('class', 'formbutton');

        $cancel = $this->createElement('button', 'back', array(
            'label' => 'Quay Lại'
                ));

        $cancel->setDecorators(array(
            'ViewHelper',
            array(
                'HtmlTag',
                array(
                    'tag' => 'hb'
                ),
                array(
                    'Label',
                    array(
                        'tag' => ''
                    )
                )
            )
        ));
        $cancel->setAttrib('class', 'formbutton');

        $this->addElement($name)->
                addElement($description)->
                addElement($order)->
                addElement($status)->
                addElement($submit)->
                addElement($reset)->
                addElement($cancel);
    }

}